package com.jiang.Service;

import com.jiang.Mapper.PersonMapper;
import com.jiang.Pojo.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("person1")
public class PersonServiceimpl implements PersonService {
    @Autowired
    PersonMapper personMapper;

    public Person getPersonbyId(int id) {
        return personMapper.getPersonbyId(id);
        //http://localhost:8080/person?id=1
    }

    public int addPerson(Person person) {
        return personMapper.addPerson(person);
    }

    public int deletePerson(int id) {
        return personMapper.deletePerson(id);
    }

    public List<Person> getAllPerson() {
        return personMapper.getAllPerson();
    }

    public int updatePerson(Person person) {
        return personMapper.updatePerson(person);
    }

}
